package com.example.nuc_ms_beta.ui.viewconstruction.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.example.nuc_ms_beta.R;
import com.example.nuc_ms_beta.app.MyApplication;
import com.example.nuc_ms_beta.bean.nucinnotice.NucInNotice_ListView;
import com.yuyh.easyadapter.abslistview.EasyLVAdapter;
import com.yuyh.easyadapter.abslistview.EasyLVHolder;

import java.util.List;

/**
 * Created by bnhc on 17-5-22.
 */

public class NucInNoticeListViewAdapter extends EasyLVAdapter<NucInNotice_ListView> {
    public NucInNoticeListViewAdapter(Context context, List<NucInNotice_ListView> list, int... layoutIds) {
        super(context, list, layoutIds);
    }

    @Override
    public void convert(EasyLVHolder holder, int position, NucInNotice_ListView nucInNotice_listView) {
      holder.setText(R.id.nucinnoticefragment_listview_group_tv,nucInNotice_listView.getListview_group());
        holder.setText(R.id.nucinnoticefragment_listview_time_tv,nucInNotice_listView.getListview_time());
        holder.setText(R.id.nucinnoticefragment_listview_title_tv,nucInNotice_listView.getListview_title());
        Glide.with(MyApplication.context)
                .load(nucInNotice_listView.getListview_image().getUrl())
                .into((ImageView) holder.getView(R.id.nucinnoticefragment_listview_iv));
    }
}
